/*
 * client_remote_master.c
 *
 *  Created on: Dec 23, 2012
 *      Author: redchen
 */

#include <lfs.h>
#include <rpc.h>
#include <lfs_protocol.h>
#include <string.h>
#include <emalloc.h>
#include <buffer.h>

#include "client_remote_master.h"

struct _remote_master_
{
    char host[HOST_LEN];
    int32_t port;
};

RemoteMaster* remote_master_init(const char* master_addr, int32_t port)
{
    RemoteMaster* master = emalloc(sizeof(RemoteMaster));
    strcpy(master->host, master_addr);
    master->port = port;
    return master;
}

//--------------------------
//-----[Bad Implement]------
//--------------------------
//not implement
void remote_master_destory(RemoteMaster* master)
{
}

Status remote_master_file_create(RemoteMaster* master, const char* name_space, int32_t min_replica, int32_t max_replica)
{
    return LFS_NOT_IMPLEMENT;
}

/**
 * Only include data size ,not include meta size
 */
int32_t remote_master_chunk_data_max_size(RemoteMaster* master)
{
    return -1;
}

/**
 * Split data to many chunk by CHUNK MAX SIZE
 */
Status remote_master_chunk_list_by_size(RemoteMaster* master, int64_t size, /*out*/List* mchunk_list)
{
    return LFS_NOT_IMPLEMENT;
}

/**
 * Delete file meta from master
 */
Status remote_master_delete(RemoteMaster* master, const char* name_space)
{
    return LFS_NOT_IMPLEMENT;
}

